home *** CD-ROM | disk | FTP | other *** search
- ; NAME count
- ; PURPOSE counts the number of characters in text1 and puts result in number1
- ; DESIGN
- ; set counter to zero
- ; load first charcter of text1
- ; while character <> control code
- ; increment counter
- ; load next charcter of text1
- ; endwhile
- ; store count in number1
-
- ; NOTE
- ; ldrb loads a register with a single byte
-
-
- mov r8, #0
- ldrb r6, [r4]
- .loop
- cmp r6, #13
- beq done
- add r8, r8, #1
- add r4, r4, #1
- ldrb r6, [r4]
- b loop
- .done
- str r8, [r1]